package com.np.demo1.callback1;

import java.util.ArrayList;
import java.util.List;

public class A {
    public List<String> wordList = loadList();

    public <T> T execute(ICallBack callBack) {
        // 将相关对词库的操作都交给 callback
        T restult = (T) callBack.process(wordList);
        return restult;
    }

    public List<String> loadList() {
        List<String> wordList = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            wordList.add(Integer.toString(i));
        }
        return wordList;
    }
}
